﻿var ApiUrl = "http://localhost:6260/";

//户内部分的数据添加
function insertIndoor() {
    var HouseUse = $("#HouseUse option").attr("id");//房实际用途编号
    var I_storey = $("#I_storey").val();//所在楼层
    var Orientation = $("#Orientation option").attr("id");//朝向编号
    var HouseForm = $("#HouseForm option").attr("id");//住宅类型编号
    var I_house = $("#I_house").val();//户型
    var EachHouseDecoration = $("#EachHouseDecoration1 option").attr("id");//各个房间的装修情况
    var I_explain = $("#I_explain").val();//有关说明
    var I_suggest = $("#I_suggest").val();//建议评估单价
    //var HouseUse = $("#HouseUse").val();//-询价记录
    var I_date = $("#I_date").val();//勘查日期时间
    var I_personnel = $("#I_personnel").val();//勘查人员签字
    var parms = {
        I_purposeID: HouseUse,
        I_storey: I_storey,
        I_orientationID: Orientation,
        I_residenceID: HouseForm,
        I_house: I_house,
        I_fitmentID: EachHouseDecoration,
        I_explain: I_explain,
        I_suggest: I_suggest,
        I_date: I_date,
        I_personnel: I_personnel
    }
    $.ajax({
        type: "post",
        url: ApiUrl + "api/Indoor/Postinsert",
        data: parms,
        //contentType: 'application/json',
        success: function (data, status) {
            if (status == "success") {
                if (data == true) {
                   
                    $("#alert").append("提交成功！");
              
                }
            }
        },
        error: function (e) {
            $("#alert").html("提交失败!");
        },
        complete: function () {

        }
    })
}
var ApiUrl = "http://localhost:6260/";
//建筑公共部位状况的数据添加
function insertBuilding() {
    var F_structureID = $("#F_structureID option").attr("id");//房屋结构
    var F_TypesID = $("#F_TypesID option").attr("id");//建筑类型
    var F_facadeID = $("#F_facadeID option").attr("id");//外立面装饰
    var F_commonalityID = $("#F_commonalityID option").attr("id");//公共部位装修
    var F_elevatorID = $("#F_elevatorID option").attr("id");//电梯
    var F_supplyID = $("#F_supplyID option").attr("id");//供气
    var F_waterID = $("#F_waterID option").attr("id");//供水
    var F_heatingID = $("#F_heatingID option").attr("id");//供暖
    var F_entranceID = $("#F_entranceID option").attr("id");//门禁系统
    var F_else = $("#F_else").val();//其他
   
    var parms = {
        F_structureID: F_structureID,
        F_TypesID: F_TypesID,
        F_facadeID: F_facadeID,
        F_commonalityID: F_commonalityID,
        F_elevatorID: F_elevatorID,
        F_supplyID: F_supplyID,
        F_waterID: F_waterID,
        F_heatingID: F_heatingID,
        F_entranceID: F_entranceID,
        F_else: F_else
    }
    $.ajax({
        type: "post",
        url: ApiUrl + "api/Facility/Postinsert",
        data: parms,
        //contentType: 'application/json',
        success: function (data, status) {
            if (status == "success") {
                if (data == true) {
                    $("#alert").empty()
                    $("#alert").append("提交成功！");
                    $("#alert").attr("style", "display:block")
                }
            }
        },
        error: function (e) {
            $("#alert").html("提交失败!");
        },
        complete: function () {

        }
    })
}
//小区状况的数据添加
function insertCommunity() {
    var C_closeID = $("#C_closeID option").attr("id");//小区封闭性
    var C_buildingID = $("#C_buildingID option").attr("id");//居住小区楼宇构成
    var C_trafficID = $("#C_trafficID option").attr("id");//交通组织方式
    var C_afforestID = $("#C_afforestID option").attr("id");//景观及绿化    
    var C_volumeID = $("#C_volumeID option").attr("id");//容积率
    var C_stallID = $("#C_stallID option").attr("id");//车位状况
    var C_propertyID = $("#C_propertyID option").attr("id");//物业公司
    //var HouseUse = $("#HouseUse").val();//-询价记录
    var C_else = $("#C_else").val();//其他
    var parms = {
        C_closeID: C_closeID,
        C_buildingID: C_buildingID,
        C_trafficID: C_trafficID,
        C_afforestID: C_afforestID,
        C_volumeID: C_volumeID,
        C_stallID: C_stallID,
        C_propertyID: C_propertyID,
        C_else: C_else
    }
    $.ajax({
        type: "post",
        url: ApiUrl + "api/Community/Postinsert",
        data: parms,
        //contentType: 'application/json',
        success: function (data, status) {
            if (status == "success") {
                if (data == true) {
                    $("#alert").empty()
                    $("#alert").append("提交成功！");
                    $("#alert").attr("style", "display:block")
                }
            }
        },
        error: function (e) {
            $("#alert").html("提交失败!");
        },
        complete: function () {

        }
    })
}

